<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件对象</title>
    <style>
        *{
            margin: 0;
            padding:0;
            user-select: none;
        }
        #box{
            width: 100%;
            height: 200px;
            background: rgb(144, 143, 194);
        }
    </style>
</head>
<body>
    <div id="box"></div>
    <script>
        let box = document.querySelector('#box');

        box.addEventListener('touchstart', function(e){
            this.style.background = 'rgb(211, 81, 30)';
            box.innerHTML = `
                同时按下的触点个数: ${e.changedTouches.length}<br>
                事件源的触点个数: ${e.targetTouches.length}<br>
                屏幕上的触点个数: ${e.touches.length}<br>
            `
            console.log(e.changedTouches);
        })

        box.addEventListener('touchmove', function(e){
            this.style.background = 'rgb(168, 192, 31)';
            box.innerHTML = `
                同时滑动的触点个数: ${e.changedTouches.length}<br>
                事件源的触点个数: ${e.targetTouches.length}<br>
                屏幕上的触点个数: ${e.touches.length}<br>
            `
        });

        box.addEventListener('touchend', function(e){
            this.style.background = 'rgb(56, 83, 212)';
            box.innerHTML = `
                同时抬起的触点个数: ${e.changedTouches.length}<br>
                事件源的触点个数: ${e.targetTouches.length}<br>
                屏幕上的触点个数: ${e.touches.length}<br>
            `
        })
    </script>
</body>
</html>